package com.hangzhou.welbeing.welbeinginstrument.utils;

import android.content.Context;
import android.content.res.Resources;

import com.hangzhou.welbeing.welbeinginstrument.base.MyApplication;

/**
 * 杭州惟君医疗科技有限公司16
 * Created by 20433 on 2018/1/29
 */

public class UIUtils {

    public static int dip2Px(int paramInt)
    {
        float f = getResources().getDisplayMetrics().density;
        return (int)(paramInt * f + 0.5F);
    }

    public static int getColor(int paramInt)
    {
        return getResources().getColor(paramInt);
    }

    public static Context getContext()
    {
        return MyApplication.getMcontext();
    }

    public static String getPackageName()
    {
        return getContext().getPackageName();
    }

    public static Resources getResources()
    {
        return getContext().getResources();
    }

    public static String getString(int paramInt)
    {
        return getResources().getString(paramInt);
    }

    public static String[] getStrings(int paramInt)
    {
        return getResources().getStringArray(paramInt);
    }

    public static int px2Dip(int paramInt)
    {
        float f = getResources().getDisplayMetrics().density;
        return (int)(paramInt / f + 0.5F);
    }
}
